<template>
    <view class="container">
        <view class="header">
            <view class="title">免费交友盲盒</view>
            <!--            <view class="location">-->
            <!--                <uni-icon type="location" size="20"></uni-icon>-->
            <!--                <input placeholder="输入地址" />-->
            <!--            </view>-->
            <!--            <view class="search">-->
            <!--                <uni-icon type="search" size="20"></uni-icon>-->
            <!--            </view>-->
        </view>

        <view class="main-content">
            <view class="tabs">
                <view class="tab-item" :class="{ active: isActive === 1 }" @click="isActive = 1">我的纸条</view>
                <view class="tab-item" :class="{ active: isActive === 0 }" @click="isActive = 0">抽个对象</view>
            </view>

            <view class="content">
                <swiper class="section-swiper" v indicator-dots="true" autoplay="true" interval="3000" duration="500">
                    <swiper-item>
                        <image src="https://placehold.co/650x300" alt="插图描述" />
                    </swiper-item>
                    <swiper-item>
                        <image src="https://placehold.co/650x300?text=线上摆摊" alt="插图描述" />
                    </swiper-item>
                    <swiper-item>
                        <image src="https://placehold.co/650x300?text=微信/朋友圈" alt="插图描述" />
                    </swiper-item>
                    <swiper-item>
                        <image src="https://placehold.co/650x300?text=转发邀请" alt="插图描述" />
                    </swiper-item>
                </swiper>

                <view class="boxes">
                    <view class="box male">
                        <image src="https://placehold.co/150x150" alt="男生盒子" />
                        <view class="box-title">男生盒子</view>
                        <button class="action-button">放入一张男生纸条</button>
                        <button class="action-button">抽取一张男生纸条</button>
                    </view>

                    <view class="box female">
                        <image src="https://placehold.co/150x150" alt="女生盒子" />
                        <view class="box-title">女生盒子</view>
                        <button class="action-button">放入一张女生纸条</button>
                        <button class="action-button">抽取一张女生纸条</button>
                    </view>
                </view>
            </view>
        </view>

        <view class="footer">
            <view class="footer-item">玩家须知</view>
            <view class="footer-item">联系客服</view>
            <view class="footer-item">分享记录</view>
        </view>
    </view>
</template>
<script>
export default {
    name: 'IndexPage',
    data() {
        return {
            isActive: 0 // 默认选中第一个 tab-item
        };
    },
    methods: {
        // 方法定义
    }
};
</script>
<style scoped>
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f8f8;
}

.title {
    font-size: 20px;
    font-weight: bold;
}

.location,
.search {
    display: flex;
    align-items: center;
}

.location input {
    border: none;
    outline: none;
    margin-left: 10px;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.tab-item {
    padding: 10px 20px;
    border-bottom: 2px solid #ddd;
}

.tab-item.active {
    border-bottom-color: #007bff; /* 设置选中状态的边框颜色 */
    color: #007bff; /* 设置选中状态的文字颜色 */
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-swiper {
    width: 100%;
    margin-bottom: 20px;
}

.boxes {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.box {
    width: 45%;
    text-align: center;
}

.box image {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.box-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.action-button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
}

.footer {
    display: flex;
    justify-content: center;
    padding: 20px;
    background-color: #f8f8f8;
}

.footer-item {
    margin: 0 10px;
}
</style>
